<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Arthas," />










<meta name="description" content="Arthas安装、命令的简单使用">
<meta name="keywords" content="Arthas">
<meta property="og:type" content="article">
<meta property="og:title" content="Arthas入门教程">
<meta property="og:url" content="http://yoursite.com/2018/12/11/Arthas入门教程/Arthas入门教程/index.html">
<meta property="og:site_name" content="程序员乌托邦">
<meta property="og:description" content="Arthas安装、命令的简单使用">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://mdsystem.oss-cn-hangzhou.aliyuncs.com/blog/88DA84C2-BF0E-48B9-B639-B8619AF99A54.png">
<meta property="og:updated_time" content="2018-12-11T07:28:08.378Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Arthas入门教程">
<meta name="twitter:description" content="Arthas安装、命令的简单使用">
<meta name="twitter:image" content="https://mdsystem.oss-cn-hangzhou.aliyuncs.com/blog/88DA84C2-BF0E-48B9-B639-B8619AF99A54.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2018/12/11/Arthas入门教程/Arthas入门教程/"/>





  <title>Arthas入门教程 | 程序员乌托邦</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">程序员乌托邦</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/12/11/Arthas入门教程/Arthas入门教程/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wolf、Heart">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="程序员乌托邦">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Arthas入门教程</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-12-11T15:26:05+08:00">
                2018-12-11
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Arthas/" itemprop="url" rel="index">
                    <span itemprop="name">Arthas</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h3 id="Arthas安装、命令的简单使用"><a href="#Arthas安装、命令的简单使用" class="headerlink" title="Arthas安装、命令的简单使用"></a>Arthas安装、命令的简单使用</h3><a id="more"></a>
<h1 id="Arthas安装"><a href="#Arthas安装" class="headerlink" title="Arthas安装"></a>Arthas安装</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">wget https://alibaba.github.io/arthas/arthas-boot.jar</span><br></pre></td></tr></table></figure>
<h1 id="打印帮助信息"><a href="#打印帮助信息" class="headerlink" title="打印帮助信息"></a>打印帮助信息</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">java -jar arthas-boot.jar -h</span><br></pre></td></tr></table></figure>
<h1 id="下载并启动程序"><a href="#下载并启动程序" class="headerlink" title="下载并启动程序"></a>下载并启动程序</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">wget https://alibaba.github.io/arthas/arthas-demo.jar</span><br><span class="line">java -jar arthas-demo.jar</span><br></pre></td></tr></table></figure>
<h1 id="使用Arthas-attach到目标程序"><a href="#使用Arthas-attach到目标程序" class="headerlink" title="使用Arthas attach到目标程序"></a>使用Arthas attach到目标程序</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">java -jar arthas-boot.jar</span><br></pre></td></tr></table></figure>
<p><img src="https://mdsystem.oss-cn-hangzhou.aliyuncs.com/blog/88DA84C2-BF0E-48B9-B639-B8619AF99A54.png" alt=""><br>这里的java对应的程序是第四个，所以输入4之后回车，会出现下载操作<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">[INFO] File size: 9.71 MB, downloaded size: 9.48 MB, downloading ...</span><br><span class="line">[INFO] File size: 9.71 MB, downloaded size: 9.50 MB, downloading ...</span><br><span class="line">[INFO] File size: 9.71 MB, downloaded size: 9.53 MB, downloading ...</span><br><span class="line">[INFO] File size: 9.71 MB, downloaded size: 9.57 MB, downloading ...</span><br><span class="line">[INFO] File size: 9.71 MB, downloaded size: 9.60 MB, downloading ...</span><br><span class="line">[INFO] File size: 9.71 MB, downloaded size: 9.63 MB, downloading ...</span><br><span class="line">[INFO] File size: 9.71 MB, downloaded size: 9.68 MB, downloading ...</span><br></pre></td></tr></table></figure></p>
<p>下载完成之后会出现<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">[INFO] Download arthas success.</span><br><span class="line">[INFO] arthas home: /Users/pengli/.arthas/lib/3.0.5/arthas</span><br><span class="line">[INFO] Try to attach process 3407</span><br><span class="line">[INFO] Attach process 3407 success.</span><br><span class="line">[INFO] arthas-client connect 127.0.0.1 3658</span><br><span class="line">  ,---.  ,------. ,--------.,--.  ,--.  ,---.   ,---.</span><br><span class="line"> /  O  \ |  .--. &apos;&apos;--.  .--&apos;|  &apos;--&apos;  | /  O  \ &apos;   .-&apos;</span><br><span class="line">|  .-.  ||  &apos;--&apos;.&apos;   |  |   |  .--.  ||  .-.  |`.  `-.</span><br><span class="line">|  | |  ||  |\  \    |  |   |  |  |  ||  | |  |.-&apos;    |</span><br><span class="line">`--&apos; `--&apos;`--&apos; &apos;--&apos;   `--&apos;   `--&apos;  `--&apos;`--&apos; `--&apos;`-----&apos;</span><br></pre></td></tr></table></figure></p>
<p>如果下载速度缓慢可以使用阿里云镜像<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">java -jar arthas-boot.jar --repo-mirror aliyun --use-http</span><br></pre></td></tr></table></figure></p>
<h1 id="查看dashboard"><a href="#查看dashboard" class="headerlink" title="查看dashboard"></a>查看dashboard</h1><p>输入dashboard，按enter/回车，会展示当前进程的信息，按ctrl+c可以中断执行。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br></pre></td><td class="code"><pre><span class="line">ID    NAME               GROUP        PRIOR STATE %CPU  TIME   INTER DAEMO</span><br><span class="line">1     main               main         5     RUNNA 99    5:8    false false</span><br><span class="line">12    AsyncAppender-Work system       9     WAITI 0     0:0    false true</span><br><span class="line">10    Attach Listener    system       9     RUNNA 0     0:0    false true</span><br><span class="line">3     Finalizer          system       8     WAITI 0     0:0    false true</span><br><span class="line">2     Reference Handler  system       10    WAITI 0     0:0    false true</span><br><span class="line">4     Signal Dispatcher  system       9     RUNNA 0     0:0    false true</span><br><span class="line">21    Timer-for-arthas-d system       10    RUNNA 0     0:0    false true</span><br><span class="line">14    job-timeout        system       9     TIMED 0     0:0    false true</span><br><span class="line">15    nioEventLoopGroup- system       10    RUNNA 0     0:0    false false</span><br><span class="line">19    nioEventLoopGroup- system       10    RUNNA 0     0:0    false false</span><br><span class="line">16    nioEventLoopGroup- system       10    RUNNA 0     0:0    false false</span><br><span class="line">17    pool-1-thread-1    system       5     TIMED 0     0:0    false false</span><br><span class="line">18    pool-2-thread-1    system       5     WAITI 0     0:0    false false</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">Memory          used       max        GC</span><br><span class="line">heap            27M   245M 3641M      gc.ps_scavenge.cou 2</span><br><span class="line">ps_eden_space   12M   64M  1344M      nt</span><br><span class="line">ps_survivor_spa 10M   10M  10M   99.8 gc.ps_scavenge.tim 19</span><br><span class="line">ce                               5%   e(ms)</span><br><span class="line">ps_old_gen      4M    171M 2731M      gc.ps_marksweep.co 0</span><br><span class="line">nonheap         20M   21M  -1    96.3 unt</span><br><span class="line">                                 9%   gc.ps_marksweep.ti 0</span><br><span class="line">code_cache      5M    5M   240M       me(ms)</span><br><span class="line"></span><br><span class="line">Runtime</span><br><span class="line">os.name            Mac OS X</span><br><span class="line">os.version         10.13.3</span><br><span class="line">java.version       1.8.0_161</span><br><span class="line">java.home          /Library/Java/Java</span><br><span class="line">                   VirtualMachines/jd</span><br><span class="line">                   k1.8.0_161.jdk/Con</span><br><span class="line">                   tents/Home/jre</span><br><span class="line">systemload.average 2.65</span><br></pre></td></tr></table></figure></p>
<h1 id="通过thread命令来获取进程的Main-Class"><a href="#通过thread命令来获取进程的Main-Class" class="headerlink" title="通过thread命令来获取进程的Main Class"></a>通过thread命令来获取进程的Main Class</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ thread -n -1 | grep &apos;main(&apos;</span><br><span class="line">    at demo.MathGame.main(MathGame.java:17)</span><br></pre></td></tr></table></figure>
<h1 id="通过jad来反编译Main-Class"><a href="#通过jad来反编译Main-Class" class="headerlink" title="通过jad来反编译Main Class"></a>通过jad来反编译Main Class</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br></pre></td><td class="code"><pre><span class="line">$ jad demo.MathGame</span><br><span class="line"></span><br><span class="line">ClassLoader:</span><br><span class="line">+-sun.misc.Launcher$AppClassLoader@75b84c92</span><br><span class="line">  +-sun.misc.Launcher$ExtClassLoader@135fbaa4</span><br><span class="line"></span><br><span class="line">Location:</span><br><span class="line">/Users/pengli/software/arthas/arthas-demo.jar</span><br><span class="line"></span><br><span class="line">/*</span><br><span class="line"> * Decompiled with CFR 0_132.</span><br><span class="line"> */</span><br><span class="line">package demo;</span><br><span class="line"></span><br><span class="line">import java.io.PrintStream;</span><br><span class="line">import java.util.ArrayList;</span><br><span class="line">import java.util.Iterator;</span><br><span class="line">import java.util.List;</span><br><span class="line">import java.util.Random;</span><br><span class="line">import java.util.concurrent.TimeUnit;</span><br><span class="line"></span><br><span class="line">public class MathGame &#123;</span><br><span class="line">    private static Random random = new Random();</span><br><span class="line">    public int illegalArgumentCount = 0;</span><br><span class="line"></span><br><span class="line">    public static void main(String[] args) throws InterruptedException &#123;</span><br><span class="line">        MathGame game = new MathGame();</span><br><span class="line">        do &#123;</span><br><span class="line">            game.run();</span><br><span class="line">            TimeUnit.SECONDS.sleep(1L);</span><br><span class="line">        &#125; while (true);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public void run() throws InterruptedException &#123;</span><br><span class="line">        try &#123;</span><br><span class="line">            int number = random.nextInt();</span><br><span class="line">            List&lt;Integer&gt; primeFactors = this.primeFactors(number);</span><br><span class="line">            MathGame.print(number, primeFactors);</span><br><span class="line">        &#125;</span><br><span class="line">        catch (Exception e) &#123;</span><br><span class="line">            System.out.println(String.format(&quot;illegalArgumentCount:%3d, &quot;, this.illegalArgumentCount) + e.getMessage());</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public static void print(int number, List&lt;Integer&gt; primeFactors) &#123;</span><br><span class="line">        StringBuffer sb = new StringBuffer(&quot;&quot; + number + &quot;=&quot;);</span><br><span class="line">        Iterator&lt;Integer&gt; iterator = primeFactors.iterator();</span><br><span class="line">        while (iterator.hasNext()) &#123;</span><br><span class="line">            int factor = iterator.next();</span><br><span class="line">            sb.append(factor).append(&apos;*&apos;);</span><br><span class="line">        &#125;</span><br><span class="line">        if (sb.charAt(sb.length() - 1) == &apos;*&apos;) &#123;</span><br><span class="line">            sb.deleteCharAt(sb.length() - 1);</span><br><span class="line">        &#125;</span><br><span class="line">        System.out.println(sb);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public List&lt;Integer&gt; primeFactors(int number) &#123;</span><br><span class="line">        if (number &lt; 2) &#123;</span><br><span class="line">            ++this.illegalArgumentCount;</span><br><span class="line">            throw new IllegalArgumentException(&quot;number is: &quot; + number + &quot;, need &gt;= 2&quot;);</span><br><span class="line">        &#125;</span><br><span class="line">        ArrayList&lt;Integer&gt; result = new ArrayList&lt;Integer&gt;();</span><br><span class="line">        int i = 2;</span><br><span class="line">        while (i &lt;= number) &#123;</span><br><span class="line">            if (number % i == 0) &#123;</span><br><span class="line">                result.add(i);</span><br><span class="line">                number /= i;</span><br><span class="line">                i = 2;</span><br><span class="line">                continue;</span><br><span class="line">            &#125;</span><br><span class="line">            ++i;</span><br><span class="line">        &#125;</span><br><span class="line">        return result;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">Affect(row-cnt:1) cost in 500 ms.</span><br></pre></td></tr></table></figure>
<h1 id="watch查看方法的返回值"><a href="#watch查看方法的返回值" class="headerlink" title="watch查看方法的返回值"></a>watch查看方法的返回值</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br></pre></td><td class="code"><pre><span class="line">watch demo.MathGame primeFactors returnObj</span><br><span class="line">Press Ctrl+C to abort.</span><br><span class="line">Affect(class-cnt:1 , method-cnt:1) cost in 44 ms.</span><br><span class="line">ts=2018-12-10 21:48:57; [cost=4067.845939ms] result=@ArrayList[</span><br><span class="line">    @Integer[1406870191],</span><br><span class="line">]</span><br><span class="line">ts=2018-12-10 21:48:58; [cost=0.543288ms] result=@ArrayList[</span><br><span class="line">    @Integer[5],</span><br><span class="line">    @Integer[5],</span><br><span class="line">    @Integer[29],</span><br><span class="line">    @Integer[89],</span><br><span class="line">    @Integer[11173],</span><br><span class="line">]</span><br><span class="line">ts=2018-12-10 21:49:04; [cost=4513.872716ms] result=@ArrayList[</span><br><span class="line">    @Integer[1728763061],</span><br><span class="line">]</span><br><span class="line">ts=2018-12-10 21:49:05; [cost=0.109169ms] result=@ArrayList[</span><br><span class="line">    @Integer[3],</span><br><span class="line">    @Integer[11],</span><br><span class="line">    @Integer[11],</span><br><span class="line">    @Integer[17],</span><br><span class="line">    @Integer[61],</span><br><span class="line">    @Integer[5639],</span><br><span class="line">]</span><br><span class="line">ts=2018-12-10 21:49:06; [cost=0.142614ms] result=null</span><br><span class="line">ts=2018-12-10 21:49:07; [cost=0.065515ms] result=null</span><br><span class="line">ts=2018-12-10 21:49:08; [cost=0.10681ms] result=null</span><br><span class="line">ts=2018-12-10 21:49:09; [cost=17.291255ms] result=@ArrayList[</span><br><span class="line">    @Integer[2],</span><br><span class="line">    @Integer[2],</span><br><span class="line">    @Integer[3],</span><br><span class="line">    @Integer[19],</span><br><span class="line">    @Integer[4625609],</span><br><span class="line">]</span><br><span class="line">ts=2018-12-10 21:49:10; [cost=0.190543ms] result=null</span><br><span class="line">ts=2018-12-10 21:49:11; [cost=0.081163ms] result=null</span><br><span class="line">ts=2018-12-10 21:49:12; [cost=0.169077ms] result=@ArrayList[</span><br><span class="line">    @Integer[2],</span><br><span class="line">    @Integer[5],</span><br><span class="line">    @Integer[103],</span><br><span class="line">    @Integer[389],</span><br><span class="line">    @Integer[2333],</span><br><span class="line">]</span><br><span class="line">ts=2018-12-10 21:49:13; [cost=0.081463ms] result=null</span><br></pre></td></tr></table></figure>
<h1 id="退出arthas"><a href="#退出arthas" class="headerlink" title="退出arthas"></a>退出arthas</h1><ol>
<li>使用exit退出当前连接</li>
<li>使用shutdown完全退出arthas</li>
</ol>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Arthas/" rel="tag"># Arthas</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/12/10/系统限流/系统限流/" rel="next" title="系统限流">
                <i class="fa fa-chevron-left"></i> 系统限流
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/12/11/Arthas进阶使用/Arthas进阶使用/" rel="prev" title="Arthas进阶使用">
                Arthas进阶使用 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Wolf、Heart</p>
              <p class="site-description motion-element" itemprop="description">主要用于分享平时学习的只是以及遇到的困难，帮助自己以及需要的人一起共同成长</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">45</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">14</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">13</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#Arthas安装、命令的简单使用"><span class="nav-number">1.</span> <span class="nav-text">Arthas安装、命令的简单使用</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Arthas安装"><span class="nav-number"></span> <span class="nav-text">Arthas安装</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#打印帮助信息"><span class="nav-number"></span> <span class="nav-text">打印帮助信息</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#下载并启动程序"><span class="nav-number"></span> <span class="nav-text">下载并启动程序</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#使用Arthas-attach到目标程序"><span class="nav-number"></span> <span class="nav-text">使用Arthas attach到目标程序</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#查看dashboard"><span class="nav-number"></span> <span class="nav-text">查看dashboard</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#通过thread命令来获取进程的Main-Class"><span class="nav-number"></span> <span class="nav-text">通过thread命令来获取进程的Main Class</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#通过jad来反编译Main-Class"><span class="nav-number"></span> <span class="nav-text">通过jad来反编译Main Class</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#watch查看方法的返回值"><span class="nav-number"></span> <span class="nav-text">watch查看方法的返回值</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#退出arthas"><span class="nav-number"></span> <span class="nav-text">退出arthas</span></a></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Wolf、Heart</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
